package uy.com.csi.gestpro.model.proyecto;

import java.io.Serializable;

import javax.persistence.*;

import uy.com.csi.gestpro.model.seguridad.GpPryctoUsrio;

import java.util.Date;
import java.util.List;

/**
 * The persistent class for the gp_prycto database table.
 * 
 */
@Entity
@Table(name = "gp_prycto", schema = "proyecto")
@NamedQuery(name = "GpPrycto.findAll", query = "SELECT g FROM GpPrycto g")
public class GpPrycto implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private Integer id;

	private Integer estdo;

	@Temporal(TemporalType.DATE)
	private Date fin;

	@Temporal(TemporalType.DATE)
	private Date incio;

	private String nmbre;

	private String rspnsble;

	// bi-directional many-to-one association to GpInfrmeDrio
	@OneToMany(mappedBy = "gpPrycto")
	private List<GpInfrmeDrio> gpInfrmeDrios;

	// bi-directional many-to-one association to GpPrsnalPrycto
	@OneToMany(mappedBy = "gpPrycto")
	private List<GpPrsnalPrycto> gpPrsnalPryctos;

	@OneToMany(mappedBy="gpPrycto")
	private List<GpGrpoActvdad> gpGrpoActvdads;
	
	// bi-directional many-to-one association to GpPryctoUsrio
	@OneToMany(mappedBy = "gpPrycto")
	private List<GpPryctoUsrio> gpPryctoUsrios;
	
	@OneToMany(mappedBy="prycto")
	private List<GpTraFtra> ftrTas;
	
	public GpPrycto() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getEstdo() {
		return this.estdo;
	}

	public void setEstdo(Integer estdo) {
		this.estdo = estdo;
	}

	public Date getFin() {
		return this.fin;
	}

	public void setFin(Date fin) {
		this.fin = fin;
	}

	public Date getIncio() {
		return this.incio;
	}

	public void setIncio(Date incio) {
		this.incio = incio;
	}

	public String getNmbre() {
		return this.nmbre;
	}

	public void setNmbre(String nmbre) {
		this.nmbre = nmbre;
	}

	public String getRspnsble() {
		return this.rspnsble;
	}

	public void setRspnsble(String rspnsble) {
		this.rspnsble = rspnsble;
	}

	public List<GpInfrmeDrio> getGpInfrmeDrios() {
		return this.gpInfrmeDrios;
	}

	public void setGpInfrmeDrios(List<GpInfrmeDrio> gpInfrmeDrios) {
		this.gpInfrmeDrios = gpInfrmeDrios;
	}

	public GpInfrmeDrio addGpInfrmeDrio(GpInfrmeDrio gpInfrmeDrio) {
		getGpInfrmeDrios().add(gpInfrmeDrio);
		gpInfrmeDrio.setGpPrycto(this);

		return gpInfrmeDrio;
	}

	public GpInfrmeDrio removeGpInfrmeDrio(GpInfrmeDrio gpInfrmeDrio) {
		getGpInfrmeDrios().remove(gpInfrmeDrio);
		gpInfrmeDrio.setGpPrycto(null);

		return gpInfrmeDrio;
	}

	public List<GpPrsnalPrycto> getGpPrsnalPryctos() {
		return this.gpPrsnalPryctos;
	}

	public void setGpPrsnalPryctos(List<GpPrsnalPrycto> gpPrsnalPryctos) {
		this.gpPrsnalPryctos = gpPrsnalPryctos;
	}

	public GpPrsnalPrycto addGpPrsnalPrycto(GpPrsnalPrycto gpPrsnalPrycto) {
		getGpPrsnalPryctos().add(gpPrsnalPrycto);
		gpPrsnalPrycto.setGpPrycto(this);

		return gpPrsnalPrycto;
	}

	public GpPrsnalPrycto removeGpPrsnalPrycto(GpPrsnalPrycto gpPrsnalPrycto) {
		getGpPrsnalPryctos().remove(gpPrsnalPrycto);
		gpPrsnalPrycto.setGpPrycto(null);

		return gpPrsnalPrycto;
	}

	public List<GpPryctoUsrio> getGpPryctoUsrios() {
		return gpPryctoUsrios;
	}

	public void setGpPryctoUsrios(List<GpPryctoUsrio> gpPryctoUsrios) {
		this.gpPryctoUsrios = gpPryctoUsrios;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GpPrycto other = (GpPrycto) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (id.intValue() != other.id.intValue())
			return false;
		return true;
	}

	public List<GpGrpoActvdad> getGpGrpoActvdads() {
		return gpGrpoActvdads;
	}

	public void setGpGrpoActvdads(List<GpGrpoActvdad> gpGrpoActvdads) {
		this.gpGrpoActvdads = gpGrpoActvdads;
	}

	public List<GpTraFtra> getFtrTas() {
		return ftrTas;
	}

	public void setFtrTas(List<GpTraFtra> ftrTas) {
		this.ftrTas = ftrTas;
	}

	

}